package cn.ava.ymcc.feign.fallback;

import cn.ava.ymcc.feign.MediaFeignClient;
import cn.ava.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {

    @Override
    public MediaFeignClient create(Throwable cause) {
        return CourseId -> JSONResult.error("媒体服务不可用,请稍后重试!");
    }
}
